import { Component } from 'react'
// import Taro, { Config } from '@tarojs/taro'
import { View } from '@tarojs/components'
import Gauge from '../../components/gauge/gauge'

import style from './index.module.less'
 

class Index extends Component {
  constructor(props) {
    super(props)
    this.state = {
      temp_percent: 0.6,
      ec: {
        renderChart: this.renderChart.bind(this)
      }
    }
  }
  
  componentDidMount () {
    const _t = this
    setTimeout(() => {
      console.log('timeout')
      _t.setState({
        temp_percent: 0.2
      })
    }, 2000)
  }

  renderChart() {
    const { temp_percent } = this.state
    return <Gauge 
      _percent={temp_percent}
    />
  }

  render () {
    return (
      <view className={style.setTemp}>
        <View className={style.container}>
            <f ec={this.state.ec} />
        </View>
      </view>
    )
  }
}


export default Index